<?php
/**
 *
 * 版权所有：恰维网络<qwadmin.qiawei.com>
 * 作    者：寒川<hanchuan@qiawei.com>
 * 日    期：2016-01-21
 * 版    本：1.0.0
 * 功能说明：前台控制器演示。
 *
 **/
namespace Home\Controller;


class SchoolController extends ComController
{
    public function info(){
        $p = isset($_GET['p']) ? intval($_GET['p']) : '1';
        $log =M('member');
        $where['uid']=$_GET['uid'];
        $member=$log->where($where)->find();
        $member['content']=html_entity_decode($member['content']);
        $this->assign('member',$member);
        $this->display();
    }
    public function memberlist(){
        $p = isset($_GET['p']) ? intval($_GET['p']) : '1';
        $where['d_id'] = $_GET['uid'];

        // 选项卡功能
        switch($_GET['type']){
            case 'all'   :break;
            case 'C1'    :
            case 'C2'    :$where['type']=$_GET['type'];break;
            case 'other' :$where['type']=array('not in','C1,C2');break;
        }

        $log =M('member');

        $pagesize = 3;
        $offset = $pagesize * ($p - 1);

        $log =M('class_level');
        $class=$log->where($where)->limit($offset.','.$pagesize)->getfield('id,type,name,price');
        $count = $log->count();
        $this->assign('class',$class);
        $this->display(); 
    }

}
 
